package com.mlethe.android.demo.seattable.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.Date;
import java.util.List;

public class Hall implements Parcelable {
    /**
     * id : 322574
     * cinePlayId : 97669
     * hallId : 400
     * hallName : 一号厅
     * businessDate : 2018-11-15
     * startTime : 2018-11-15 16:15:00
     * endTime : 2018-11-15 16:45:00
     * priceType : 1
     * price : 80
     * marketPrice : 10
     * lowestPrice : 30
     * seatTotalNum : 204
     * seatAvailableNum : 204
     * allowBook : 1
     * cineUpdateTime : 2018-11-11 10:16:52
     * partnerPrice : 10.01
     */

    private String id;
    private List<MovieInfo> movieInfo;
    private String cinePlayId;
    private String hallId;
    private String hallName;
    private String businessDate;
    private Date startTime;
    private Date endTime;
    private int priceType;
    private double price;
    private double marketPrice;
    private double lowestPrice;
    private int seatTotalNum;
    private int seatAvailableNum;
    private int allowBook;
    private String cineUpdateTime;
    private double partnerPrice;
    private List<AreaInfo> areaInfo;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public List<MovieInfo> getMovieInfo() {
        return movieInfo;
    }

    public void setMovieInfo(List<MovieInfo> movieInfo) {
        this.movieInfo = movieInfo;
    }

    public String getCinePlayId() {
        return cinePlayId;
    }

    public void setCinePlayId(String cinePlayId) {
        this.cinePlayId = cinePlayId;
    }

    public String getHallId() {
        return hallId;
    }

    public void setHallId(String hallId) {
        this.hallId = hallId;
    }

    public String getHallName() {
        return hallName;
    }

    public void setHallName(String hallName) {
        this.hallName = hallName;
    }

    public String getBusinessDate() {
        return businessDate;
    }

    public void setBusinessDate(String businessDate) {
        this.businessDate = businessDate;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public int getPriceType() {
        return priceType;
    }

    public void setPriceType(int priceType) {
        this.priceType = priceType;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(double marketPrice) {
        this.marketPrice = marketPrice;
    }

    public double getLowestPrice() {
        return lowestPrice;
    }

    public void setLowestPrice(double lowestPrice) {
        this.lowestPrice = lowestPrice;
    }

    public int getSeatTotalNum() {
        return seatTotalNum;
    }

    public void setSeatTotalNum(int seatTotalNum) {
        this.seatTotalNum = seatTotalNum;
    }

    public int getSeatAvailableNum() {
        return seatAvailableNum;
    }

    public void setSeatAvailableNum(int seatAvailableNum) {
        this.seatAvailableNum = seatAvailableNum;
    }

    public int getAllowBook() {
        return allowBook;
    }

    public void setAllowBook(int allowBook) {
        this.allowBook = allowBook;
    }

    public String getCineUpdateTime() {
        return cineUpdateTime;
    }

    public void setCineUpdateTime(String cineUpdateTime) {
        this.cineUpdateTime = cineUpdateTime;
    }

    public double getPartnerPrice() {
        return partnerPrice;
    }

    public void setPartnerPrice(double partnerPrice) {
        this.partnerPrice = partnerPrice;
    }

    public List<AreaInfo> getAreaInfo() {
        return areaInfo;
    }

    public void setAreaInfo(List<AreaInfo> areaInfo) {
        this.areaInfo = areaInfo;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeTypedList(this.movieInfo);
        dest.writeString(this.cinePlayId);
        dest.writeString(this.hallId);
        dest.writeString(this.hallName);
        dest.writeString(this.businessDate);
        dest.writeLong(this.startTime != null ? this.startTime.getTime() : -1);
        dest.writeLong(this.endTime != null ? this.endTime.getTime() : -1);
        dest.writeInt(this.priceType);
        dest.writeDouble(this.price);
        dest.writeDouble(this.marketPrice);
        dest.writeDouble(this.lowestPrice);
        dest.writeInt(this.seatTotalNum);
        dest.writeInt(this.seatAvailableNum);
        dest.writeInt(this.allowBook);
        dest.writeString(this.cineUpdateTime);
        dest.writeDouble(this.partnerPrice);
        dest.writeTypedList(this.areaInfo);
    }

    public Hall() {
    }

    protected Hall(Parcel in) {
        this.id = in.readString();
        this.movieInfo = in.createTypedArrayList(MovieInfo.CREATOR);
        this.cinePlayId = in.readString();
        this.hallId = in.readString();
        this.hallName = in.readString();
        this.businessDate = in.readString();
        long tmpStartTime = in.readLong();
        this.startTime = tmpStartTime == -1 ? null : new Date(tmpStartTime);
        long tmpEndTime = in.readLong();
        this.endTime = tmpEndTime == -1 ? null : new Date(tmpEndTime);
        this.priceType = in.readInt();
        this.price = in.readDouble();
        this.marketPrice = in.readDouble();
        this.lowestPrice = in.readDouble();
        this.seatTotalNum = in.readInt();
        this.seatAvailableNum = in.readInt();
        this.allowBook = in.readInt();
        this.cineUpdateTime = in.readString();
        this.partnerPrice = in.readDouble();
        this.areaInfo = in.createTypedArrayList(AreaInfo.CREATOR);
    }

    public static final Creator<Hall> CREATOR = new Creator<Hall>() {
        @Override
        public Hall createFromParcel(Parcel source) {
            return new Hall(source);
        }

        @Override
        public Hall[] newArray(int size) {
            return new Hall[size];
        }
    };
}
